package com.frxuexi.park2209.patrol

import androidx.lifecycle.MutableLiveData
import com.frxuexi.base.mvvm.BaseViewModel
import com.frxuexi.base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class PatrolViewModel @Inject constructor(val apiService: ApiService):BaseViewModel() {
    var patrolsSuc=MutableLiveData<String>()
    var mypatrolsSuc=MutableLiveData<String>()

    var selPointSuc=MutableLiveData<String>()

    fun selALLPatroles(){
        httpRequest({apiService.selALLPatroles()},patrolsSuc::postValue)
    }

    fun selMyPatroles(map: Map<String,Int>){
        httpRequest({apiService.selPatrol(mapToBody(map))},mypatrolsSuc::postValue)
    }

    fun selPoint(){
        httpRequest({apiService.selSysPoint()},selPointSuc::postValue)
    }

}